<?php
	include "../../public/commom/config.php";
	include "../lock2.php";
	
	if($_POST) {
		$class_id = $_POST["class_id"];
		$title = $_POST["title"];
		$content = $_POST["content"];
		$id = $_POST["id"];
	
		$sql = "UPDATE news SET title = '$title', content = '$content', class_id = '$class_id' WHERE id = $id";
			
		$result = mysqli_query($conn, $sql);
		
		mysqli_close($conn);
			
		header("Location: ./index.php");
	}
?>